package com.mapproject.industrymap.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mapproject.industrymap.entity.PropertiesDictEntity;
import com.mapproject.industrymap.entity.SysUserEntity;
import com.mapproject.industrymap.mapper.SysDictMapper;
import com.mapproject.industrymap.mapper.SysUserMapper;
import com.mapproject.industrymap.service.SysDictService;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, PropertiesDictEntity>  implements SysDictService {
    @Autowired
    SysDictMapper sysDictMapper;
    public ReturnValue getDictInfo(String chsourcelayer){
        QueryWrapper<PropertiesDictEntity> queryWrapper=new QueryWrapper<>();
        if(chsourcelayer.equals("all")){
            queryWrapper
                    .eq("status","1");
        }else{

            queryWrapper
                    .eq("status","1")
                    .eq("chsourcelayer",chsourcelayer);

        }

        List<Map<String, Object>> maps = sysDictMapper.selectMaps(queryWrapper);
        return new ReturnValue(200,"查询结果",maps);
    }
}
